﻿using System.Web.Mvc;
using System.Web.Routing;

namespace yiCommerce.App_Start
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "install",
                "install",
                new {area = "Install", controller = "Install", action = "Index"}
                );

            routes.MapRoute(
                "orders",
                "orders",
                new {area = "", controller = "Order", action = "List"}
                );
            routes.MapRoute(
                "MyInterstedTags",
                "MyInterstedTags",
                new {area = "", controller = "Tags", action = "MyInterestedTags"}
                );

            routes.MapRoute(
               "ConfigTags",
               "ConfigTags",
               new { area = "", controller = "CustomerTag", action = "ChooseIneterstedTags", isFromRegist = false}
               );

            routes.MapRoute(
                "ChooseTags",
                "ChooseTags",
                new {area = "", controller = "CustomerTag", action = "ChooseIneterstedTags",isFromRegist=true}
                );

            routes.MapRoute(
                "statusestaged",
                "statuses",
                new {area = "", controller = "statuses", action = "StatusTaged"}
                );


            routes.MapRoute(
                "cart",
                "cart",
                new {area = "", controller = "ShoppingCart", action = "cart"}
                );

            routes.MapRoute(
                "statushomepage",
                "statuses/{customerid}",
                new {area = "", controller = "Statuses", action = "Show"}
                );

            routes.MapRoute(
                "statusdetail",
                "status/{statusid}",
                new {area = "", controller = "Statuses", action = "status"}
                );

            routes.MapRoute(
                "login",
                "login",
                new {area = "", controller = "Customer", action = "Login"}
                );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new {controller = "Home", action = "Index", id = UrlParameter.Optional},
                namespaces: new string[] {"yiCommerce.Controllers"}
                );
        }
    }
}